﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AesonBaseFramework.EntityFramework.DbContexts;
using AesonIdentityLibrary.DataModel;

namespace AesonIdentityLibrary.DataContext
{
    public class SecurityDbContext : AesonSqlDbContext
    {
        public SecurityDbContext(DbConnectionInfo connection)
            : base(connection)
        {
                
        }

        public SecurityDbContext()
            : base(DbConnectionInfo.Create("TestUser", "AesonDev01", "IntegrationModel"))
        {
                
        }
        public new static SecurityDbContext Create(DbConnectionInfo connection)
        {
           return  new SecurityDbContext(connection);
        }

        public static DbConnectionInfo Connection { get; set; }

        public static SecurityDbContext CreateForOwin()
        {
            return new SecurityDbContext(Connection);
        }

        public DbSet<ApplicationUser> Users { get; set; }
        public DbSet<ClientApplication> ClientApplications { get; set; }
        public DbSet<UserClientAppAssignation> UserClientAppAssignations { get; set; }
        public DbSet<UserClaim> UserClaims { get; set; }
        public DbSet<UserAuthorizationAssignation> UserAuthorizationAssignations { get; set; }
     
    }

}
